Copyright: PrintFile 1.0  Copyright 1996 by Peter Lerup


Contents
PrintFile

Version 1.0

Copyright 1996 by Peter Lerup. All rights reserved

Contents

Overview

Installation

Printing Files

Program Settings

Technical information

Legal Issues

Author


Overview

PrintFile is a freeware utility program which can be used to send files directly to a Windows printer. The program is a Windows replacement for the DOS command "copy/b filename LPTx" . As opposed to this DOS command, PrintFile works well with network printers which has no connection to any LPTx. The program is mainly intended for printing PostScript files but may just as well be used for any file created by a by the "Print to File" option available for most Windows printer drivers. Such a print file can for instance be created on a PC without a printer and then be moved to another PC that has a printer, and here be sent to the printer using PrintFile.

Selection of which files to print can be made by the normal Windows file selection dialog, or by Drag and Drop operations with one or several files. The latter facilitates batch printing of files. The standard Windows printing dialog is used for selection of printer and number of copies to print.

PrintFile also has the possibility to print Encapsulated PostScript Files (EPS). These files can normally only be inserted into documents and not be printed directly. The program also offers some options for the positioning and layout of the EPS picture on the printer page. Both EPS files with and without preview can be handled.

Another PostScript feature is the possibility to select an arbitrary range of pages for the printout when printing multiple page PostScript files. This can for instance be used for printing only odd or even pages.

PrintFile can also handle PostScript and EPS files created on a Macintosh.

The program is available in both 16-bit (Windows 3.1x) and 32-bit (Windows 95 and NT) versions.

A word of warning !

PrintFile is a power user tool and should be used with care. It is important that the files which are sent to a printer is intended for that type of printer. A PCL printer, for instance, can NOT print a PostScript file.


Installation

Requirements

PrintFile requires a PC running one of the following versions of Microsoft Windows:

º  Windows 3.1

º  Windows 3.11

º  Windows 95

º  Windows NT 3.51 or later

How to install PrintFile

In order to install PrintFile you first have to unzip the PrintFile ZIP archive file. The archive has the following contents:

README.TXT	A short description in text format
PRFILE.EXE	Executable for Windows 3.1 and 3.11
PRFILE32.EXE	Executable for Windows 95 and NT
PRFILE.HLP	Windows Help File (this file)

Unzip the archive into a new directory e.g. C:\PRFILE . Depending on which version of Windows that you are using, you can then remove the obsolete executable. Please note that it is important to select the correct executable, it will not run on another operating system than the one it was intended for.

For convenient use you can then create a program manager icon (or in Windows 95 a Taskbar menu item) for the executable. When using Windows 95 it might be a good idea to create a desktop shortcut to PrintFile. This can be used for easy Drag and Drop printing.

How to remove PrintFile

Should you want to stop using PrintFile then it is very easy to remove it. Just delete the directory that you created during the installation. If you created Program Manager icons or shortcuts just remove them as well. If there is a file named PRFILE*.INI in the Windows directory, it should also be removed.


Printing Files

PrintFile usage is very simple and straightforward. When started, PrintFile shows a main dialog box with some buttons and an operation status field. To print just press the Print File... button or Drag and Drop files onto the program main dialog box.

When pressing the Print File.. button the standard Window file selection dialog box will be shown. The default file extension is for PostScript files, but other extensions can be selected as well. Select a file to be printed. Note that only one file can be selected in this way. An alternative approach is to select files to be printed in the Windows File Manager or the Windows 95 Explorer. Then Drag and Drop the files from here onto PrintFile's main dialog box. In this case an arbitrary number of files can be selected.

When file selection has been made the next thing that happens is that the standard Windows printer selection dialog box is shown. Here it is possible to select which printer that the file(s) should be sent to. It is also possible to choose the number of print copies that should be made. The printer selection dialog is only shown once when printing multiple files. The dialog box can be disabled in the Settings dialog in case no printer selection is wanted and the default printer always should be used.

Press the Settings... button to activate the dialog box controlling the preferences in PrintFile.

The About... button activates a dialog box with PrintFile version information.

During printout the status field shows the name of the file that is currently being printed. As long as the printing continues the Stop button is enabled. Press it to cancel printing.

When printing multiple page DSC compliant PostScript files the page range selection field in the printer selection dialog box is also activated. Here the number of pages is show. In this standard dialog it is only possible to select one simple range of pages. Therefore, if the radio button for page range printing is selected, a new dialog box will be shown after this dialog box. Here it is possible to select a more complex range of pages. Note that this dialog box will only be shown if the page range radio button is selected. The dialog looks like this:

The page selection list box shows the field from the DSC page comments. These normally has two fields. The first field is a label that can contain an arbitrary text field that might vary between applications that create PostScript files. The second field contains the actual page number. This dialog box can also be disabled in the Settings dialog.


Technical Information

PrintFile is implemented using the Visual C++ environment. Version 1.52 is used for the 16-bit PrintFile and version 4.0 for the 32-bit PrintFile.

The 16-bit version of PrintFile uses the PASSTHROUGH escape to send files to a printer, whereas the 32-bit version uses the API function WritePrinter.


Legal Issues

Distribution

PrintFile is freeware i.e. you can use it free of charge and no registration is required. If you however find any use for this program it would be very interesting for me, Peter Lerup, to know. Please send a mail to one of the addresses listed here or preferably send me a nice postcard of your home town. I think this is a reasonable award for my efforts to create this program.

Even though PrintFile is freeware, it is not in the public domain, I reserve all rights to it. You may freely distribute copies of PrintFile as long as you do so in an unmodified form and include all files and documentation which are present in this archive. You may not charge for the distribution of PrintFile other than a reasonable fee to cover your distribution costs.

The program may not be bundled with any kind of commercial products without the express permission from me.

Distribution on SimTel CD-ROMs is permitted.

DISCLAIMER OF WARRANTY.

SINCE THE SOFTWARE IS PROVIDED FREE OF CHARGE, THE INFORMATION AND CODE PROVIDED IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. UNDER NO CIRCUMSTANCES SHALL PETER LERUP BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF PETER LERUP HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.

Trademarks

PostScript is a registered trademark of Adobe Systems.
Microsoft,  Windows, Windows 95 and Windows NT are registered trademarks of Microsoft Corporation.
Macintosh is a registered trademark of Apple Computer.


PrintFile Author Peter Lerup

If you have suggestions, messages or bug reports, the author Peter Lerup can be reached at the following addresses:

E-mail:	ptl@automation.alfalaval.se
WWW:	http://ourworld.compuserve.com/homepages/P_Lerup/
CompuServe:	100136,2165

Check out the Web-site above for the latest information about PrintFile.

If you are kind enough to send a postcard, this is the snail mail address:

Peter Lerup
Ribevägen 11 B
S-217 46  MALMÖ
SWEDEN

Credits

Special thanks to Folke Larsson (bfl@automation.alfalaval.se) for testing and exchange of ideas on design and layout.


PrintFile Settings

PrintFile has a number of settings (preferences) that can be changed in order to control the behavior of the program. The settings are controlled by a dialog box which is activated by pressing the Settings... button in the main dialog box.

The Settings dialog box has three groups of settings controlled by check boxes.

PostScript

Use end of file character (^D)

Check this box in order to make PrintFile add the PostScript end of file character (ASCII 04) first and last in the data sent to the printer. This option should normally be checked.

Enable page selection

When this box is checked PrintFile looks for DSC compliant PostScript files before the printing starts. When such a file is found PrintFile counts the number of pages and enables printing of page ranges. Uncheck this box to speed up printing when no range selection is wanted.

Encapsulated PostScript

Encapsulated PostScript files always has a bounding box comment which describes the size and position of the picture. This information can be used by PrintFile to position the picture on the page when printing. The following options are available:

º  Keep original size and place: No change is made the to the PostScript coordinate system, the picture is printed "As is"

º  Center on page: The coordinate system is changed in order to place the picture in its original size in the center of the printer page.

º  Center and scale to fit page: Same as above but the size of the picture is changed so that it fits the size of the printer page. Equal x and y scaling is used, i.e. no distortion of the picture.

Frame bounding box

Check this box in order to get a thin frame around the picture bounding box.

Print file name

When checked the name of the EPS file is printed in the upper left corner of the paper. Convenient when printing a batch of EPS files.

General

Always use default printer

This option can be used to disable the Printer selection dialog. The default printer selected by a command line switch, or the printer selected as the default in the Windows Print Manager will always be used.

Quit when handled command line

Means that PrintFile will always quit after it has printed the files provided on the command line that invoke it.


Document Structuring Conventions (DSC)

Adobe has defined a set of extended comment conventions that provide additional information about the page structure and resource requirements of a PostScript file. If a file contains these Document Structuring Convention (DSC) comments, PrintFile can let the user select subranges of pages for printing.

If a file does not contain DSC comments, PrintFile can only print all the pages. DSC compliant files start with the comment line:

 %!PS-Adobe-3.0

where the number 3.0 may change and is the DSC version number. Some programs write PostScript files with a control-D as the first character of the file, followed by the comment line mentioned above. This type of behavior is accepted by PrintFile.

DSC compliant files contain lines such as:

%%Pages: 24
%%Page: 1 1

These lines tell PrintFile how many pages a document contains and where they start. PrintFile uses this information to select individual pages.


Command line usage

PrintFile can be controlled by adding parameters to the command line that invokes it. The parameters are interpreted as file names and these files will be printed. The following qualifiers are also recognized:

/q

Quiet mode. No main window or dialog boxes will be shown. The files will just be printed on the default printer. When all files have been treated, the program will terminate.

/p:printername

This parameter sets up the default printer for PrintFile to printername. If this parameter is not present, the default printer from the Print Manager will be used. Use this parameter to create convenient icons for different printers. This qualifier is ONLY valid in the 32-bit version of PrintFile.

Always when command line parameters are present the program terminates after printing the files if the entry Quit when handled command line in the Settings dialog is set.